import type { BaseResponse_boolean_ } from "../models/BaseResponse_boolean_";
import type { BaseResponse_Dorm_ } from "../models/BaseResponse_Dorm_";
import type { BaseResponse_string_ } from "../models/BaseResponse_string_";
import type { Dorm } from "../models/Dorm";
import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";

export class DormControllerService {
  /**
   * adddorm
   * @param dorm dorm
   * @returns BaseResponse_boolean_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static adddormUsingPost(
    dorm: Dorm
  ): CancelablePromise<BaseResponse_boolean_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/dorm/add",
      body: dorm,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * deteledorm
   * @param dorm dorm
   * @returns BaseResponse_string_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static deteledormUsingPost(
    dorm: Dorm
  ): CancelablePromise<BaseResponse_string_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/dorm/delete",
      body: dorm,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * seaarchdorm
   * @param dormName dormName
   * @returns BaseResponse_Dorm_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static seaarchdormUsingPost(
    dormName?: string
  ): CancelablePromise<BaseResponse_Dorm_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/dorm/search",
      query: {
        dormName: dormName,
      },
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * updatedorm
   * @param dorm dorm
   * @returns BaseResponse_string_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static updatedormUsingPost(
    dorm: Dorm
  ): CancelablePromise<BaseResponse_string_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/dorm/update",
      body: dorm,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }
}
